import React from 'react';
import { Button } from 'antd';
import { connect } from 'dva';


const MyPage = ({
  dispatch, products
}) => {
  const onClick = (e) => {
    e.preventDefault();
    dispatch({
      type: 'products/getUser',
      payload: { id: 1 },
    });

  };
  return (
    <React.Fragment>
      <h2>List of MyPage new</h2>
      <Button type="primary" onClick={onClick}>点我后，查看打开控制台</Button>
    </React.Fragment>
  );
};

export default connect(({ products }) => ({
  products,
}))(MyPage);

